<template>
	<div>
		<msg v-if='isshowmsg' title='操作失败' description='未登录用户不允许访问,请登录' icon='warn' :buttons="buttons">

		</msg>
	</div>
</template>

<script>
	import {Msg} from 'vux'
	export default {
		components: {
			Msg
		},
		data: function() {
			return {
				isshowmsg:false,//用户登录状态
				buttons: [
					{
					type: 'primary',
					text: '跳转到登录页面',
					link:'/#/login'
					},
				]
			}
		},
		created: function() {
			if (this.$store.state.isLoginde == false) {
				this.isshowmsg=true;
				return;
			}
			//注销操作
			//1 vuex中状态数据恢复  调用mutations中的函数
			this.$store.commit('mutationlogout');
			//2 情况localstorage中的数据
			window.localStorage.clear();
			//3 页面跳转
			this.$router.push('/');
		}
	}
</script>

<style>
</style>
